{% extends 'index.html' %}

{% block  title %}
<title>图书信息录入</title>
{% endblock %}

{% block con %}
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">录入表单</div>
                    <div class="widget-function am-fr">
                        <a href="javascript:;" class="am-icon-cog"></a>
                    </div>
                </div>
                <div class="widget-body am-fr">

                    <form action="{{ url_for('admin.book_insert') }}" method="POST" enctype="multipart/form-data" class="am-form tpl-form-line-form">
                        <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-3 am-form-label">
                                书名 
                            </label>
                            <div class="am-u-sm-9">
                                <input type="text" name="title" class="tpl-form-input"  >
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-3 am-form-label">
                                作者 
                            </label>
                            <div class="am-u-sm-9">
                                <input type="text" name="author" class="tpl-form-input"  >
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-3 am-form-label">
                                豆瓣评分
                            </label>
                            <div class="am-u-sm-9">
                                <input type="text" name="score" class="tpl-form-input"  >
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-3 am-form-label">
                                出版信息
                            </label>
                            <div class="am-u-sm-9">
                                <input type="text" name="publisher" class="tpl-form-input"  >
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-3 am-form-label">
                                单价
                            </label>
                            <div class="am-u-sm-9">
                                <input type="text" name="price" class="tpl-form-input"  >
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-3 am-form-label">
                                数量
                            </label>
                            <div class="am-u-sm-9">
                                <input type="text" name="qty" class="tpl-form-input"  >
                            </div>
                        </div>
                        
                        <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-3 am-form-label">
                                ISBN书号
                            </label>
                            <div class="am-u-sm-9">
                                <input type="text" name="isbn13" class="tpl-form-input"  >
                            </div>
                        </div>

                         <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-3 am-form-label">
                                备注说明
                            </label>
                            <div class="am-u-sm-9">
                                <input type="text" name="Explain" class="tpl-form-input"  placeholder="图书所属人 例如: 张三">
                            </div>
                        </div>
                        
                      
                        <div class="am-form-group">
                            <label for="user-weibo" class="am-u-sm-3 am-form-label">封面图 
                            </label>
                            <div class="am-u-sm-9">
                                <div class="am-form-group am-form-file">
                                    <div class="tpl-form-file-img">
                                        <img style="width: 200px;" id="fileimg" src="assets/img/a5.png" alt="">
                                    </div>
                                    <button type="button" class="am-btn am-btn-danger am-btn-sm">
                                        <i class="am-icon-cloud-upload"></i> 添加封面图片</button>
                                    <input id="doc-form-file" name="image" type="file" multiple="">
                                </div>

                            </div>
                        </div>
                        <script type="text/javascript">
                            $('input[name=image]').change(function(){
                                var t = this
                                var file = t.files[0],//拿到原始对象
                                reader = new FileReader();
                                reader.readAsDataURL(file);
                                //文件加载成功以后，渲染到页面
                                reader.onload = function() {
                                    $('#fileimg').attr('src',reader.result)
                                }
                            })
                        </script>



                        <div class="am-form-group">
                            <label for="user-intro" class="am-u-sm-3 am-form-label">图书简介</label>
                            <div class="am-u-sm-9">
                                <textarea name="Recommend" class="" rows="10" placeholder="图书简介"></textarea>
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label for="user-intro" class="am-u-sm-3 am-form-label">作者简介</label>
                            <div class="am-u-sm-9">
                                <textarea name="authorinfo" class="" rows="10" placeholder="作者简介"></textarea>
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label for="user-intro" class="am-u-sm-3 am-form-label">图书目录</label>
                            <div class="am-u-sm-9">
                                <textarea name="Catalog" class="" rows="10" placeholder="图书目录"></textarea>
                            </div>
                        </div>

                        <div class="am-form-group">
                            <div class="am-u-sm-9 am-u-sm-push-3">
                                <button class="am-btn am-btn-primary tpl-btn-bg-color-success ">录入</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

{% endblock %}




